<form id="formEdit">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">操作</h4>
            </div>
            <div class="modal-body">
            	<!-- 以下为要修改的的内容 -->
				<input type="hidden" name="id" data-bind="value:editModel.id">
                <div class="form-group">
                	<label for="txt_name">班级名称</label>
                    <input type="text" name="name" data-bind="value:editModel.name" class="form-control" id="name" placeholder="班级名称">
                </div>
                <div class="form-group">
                	<label for="txt_manager">班主任</label>
                    <input type="text" name="manager" data-bind="value:editModel.manager" class="form-control" id="txt_manager" placeholder="班主任">
                </div>
                <!-- 以上为要修改的内容 -->
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭</button>
            </div>
        </div>
    </div>
</form>
<script type="text/javascript" th:inline="javascript">
    $(function () {
　　　　 var editData = [[${model}]];  //取出后台传来的model对象字串
　　　　// var editDataStr = [[${model}]];  //取出后台传来的model对象字串
　　　　 //var editData =eval('('+editDataStr+')');
        ko.bindingEditViewModel(editData, {
			name: {
				validators: {
					notEmpty: {
						message: '班级名称不能为空'
					}
				}
			},
			manager: {
				validators: {
					notEmpty: {
						message: '班主任不能为空'
					}
				}
			}
        }); 
    });
</script>